package com.quinn.myDemo.testforcode;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaAlihealthDrugBillUpbillDetailWithcodeRequest;
import com.taobao.api.request.AlibabaAlihealthDrugKytListpartsRequest;
import com.taobao.api.request.AlibabaAlihealthDrugKytSearchbillRequest;
import com.taobao.api.response.AlibabaAlihealthDrugBillUpbillDetailWithcodeResponse;
import com.taobao.api.response.AlibabaAlihealthDrugKytListpartsResponse;
import com.taobao.api.response.AlibabaAlihealthDrugKytSearchbillResponse;

import java.util.ArrayList;
import java.util.List;

/**
 * KytSearchbill
 * 查询本企业出入库
 * @author HanQuinn
 * Date: 2024/9/25
 * Time: 15:29
 */
public class KytSearchbill {

    public static void main(String[] args) {
        try {
            TaobaoClient client = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest", "34695618", "37ade9e9219e9dc86bf58d2e1c5282b9");
            AlibabaAlihealthDrugKytSearchbillRequest req = new AlibabaAlihealthDrugKytSearchbillRequest();
            req.setRefEntId("eddba00125164822823e6484c35d5d93");
            req.setAuthRefUserId("eddba00125164822823e6484c35d5d93");
            req.setBeginDate("2024-01-01");
            req.setEndDate("2024-09-25");
            req.setBillType("AO");
            req.setCurPage(27L);
            req.setPageSize(200L);
            AlibabaAlihealthDrugKytSearchbillResponse rsp = client.execute(req);
            System.out.println(rsp.getBody());
//            String read = JSONPath.read(rsp.getBody(), "$.alibaba_alihealth_drug_kyt_searchbill_response.result.model.result_list.bill_chk_in_out_do",String.class);
//            List<KytBill> kytBills = JSONObject.parseArray(read, KytBill.class);
//            String A = "";
        } catch (ApiException e) {
            System.out.println(e.getSubErrMsg());
        }
    }

}
